import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/manage/config',
    method: 'get',
    params: query
  })
}

export function fetchConfig() {
  return request({
    url: '/manage/config',
    method: 'get'
  })
}

export function saveConfig(data) {
  return request({
    url: '/manage/config',
    method: 'post',
    data
  })
}

export function updateConfig(data) {
  return request({
    url: '/manage/config/' + data.id,
    method: 'put',
    data
  })
}

export function deleteConfig(id, status) {
  return request({
    url: '/manage/config/' + id,
    method: 'delete',
    data: { flag: status }
  })
}
